package com.gitee.l0km.beanfilter.annotations;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import com.gitee.l0km.beanfilter.core.Activation;
import com.gitee.l0km.beanfilter.core.CodecPhase;
import com.gitee.l0km.beanfilter.core.CodecScope;
import com.gitee.l0km.beanfilter.core.SimpleValueFilter;
import com.gitee.l0km.casban.ctor.annotations.CtorArg;
import com.gitee.l0km.common.spring.core.annotation.AliasFor;

/**
 * 基于{@link SimpleValueFilter}的简单值过滤器注解<br>
 * 字段说明参见 {@link SimpleValueFilter#SimpleValueFilter(Class, boolean, String, String, Class, Class[], String[], boolean) }
 * 和{@link FilterMeta}同名字段
 * @author guyadong
 *
 */
@Retention(RUNTIME)
@Target({ METHOD })
@ValueFilter(filterClass = SimpleValueFilter.class)
@Repeatable(ConstantValueFilters.class)
public @interface ConstantValueFilter {
	@CtorArg(0)
	@AliasFor(annotation = FilterMeta.class,attribute = "beanClass")
	Class<?> beanClass() default Object.class;
	@CtorArg(1)
	boolean autoCase() default false;
	@CtorArg(2)
	String filterName();
	@CtorArg(3)
	String consant();
	@CtorArg(4)
	Class<?> constantType() default Object.class;
	@CtorArg(5)
	Class<? extends Activation>[]  activeOn() default {};
	@CtorArg(6)
	String[]  activeOnClassNames() default {};
	@CtorArg(7)
	boolean  activeAnd() default true;
	/**
	 * @see FilterMeta#phase()
	 */
	@AliasFor(annotation = FilterMeta.class,attribute = "phase")
	CodecPhase phase() default CodecPhase.SERIALIZATION;
	/**
	 * @see FilterMeta#scope()
	 */
	@AliasFor(annotation = FilterMeta.class,attribute = "scope")
	CodecScope scope() default CodecScope.ALL;
}
